package cn.edu.whu.irlab.web;

import cn.edu.whu.irlab.model.Question;
import cn.edu.whu.irlab.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by Roger on 2016/8/1.
 */
@Controller
@RequestMapping("/question")
public class QuestionController {

    @Autowired
    private QuestionService questionService;

    @RequestMapping(value = "/{questionId}", method = RequestMethod.GET)
    public String getQuestion(@PathVariable Integer questionId,
                              Model model){
//        model.addAttribute("question", questionService.selectByPrimaryKey(questionId));
        return "";
    }

    @RequestMapping(value = "/create", method = RequestMethod.POST)
    public String createQuestion(Question question){
//        questionService.insertSelective(question);
        return "";
    }

    @RequestMapping(value = "/update", method = RequestMethod.POST)
    public String updateQuestion(Question question){
//        questionService.updateByPrimaryKeySelective(question);
        return "";
    }
}
